package newsserver;

public class DatabaseClient {

    // input example: <count>3</count>
    // output example: <list><id>5</id><id>9</id><id>10</id></list>

    public static String listArticles(java.lang.String count) {
        server.NewWebServiceService service = new server.NewWebServiceService();
        server.NewWebService port = service.getNewWebServicePort();
        return port.listArticles(count);
    }
    
    // input example: <id>1</id>
    // output example: <article><id>...</id><title>...</title><content>...</content><category>...</category><authorID>...</authorID><time>...</time></article>

    public static String getArticle(java.lang.String id) {
        server.NewWebServiceService service = new server.NewWebServiceService();
        server.NewWebService port = service.getNewWebServicePort();
        return port.getArticle(id);
    }

    // input example: <id>1</id>
    // output example: <name>someone</name>

    public static String getAuthor(java.lang.String id) {
        server.NewWebServiceService service = new server.NewWebServiceService();
        server.NewWebService port = service.getNewWebServicePort();
        return port.getAuthor(id);
    }
    
    // input example: <category>Symaskiner</category>
    // output example: <list><id>1</id><id>2</id></list>

    public static String browseCategory(java.lang.String category) {
        server.NewWebServiceService service = new server.NewWebServiceService();
        server.NewWebService port = service.getNewWebServicePort();
        return port.browseCategory(category);
    }

    public static String listCategories() {
        server.NewWebServiceService service = new server.NewWebServiceService();
        server.NewWebService port = service.getNewWebServicePort();
        return port.listCategories();
    }

}
